<%-- 
    Document   : izmeniPacient
    Created on : 18.5.2011, 01:16:
    Author     : Ruzin
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="com.zproekt.entity.Pacient" %>
<%@page import="com.zproekt.servis.OrdinacijaCRUD" %>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<link rel="stylesheet" type="text/css" href="style.css" />

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Промена на пациент</title>
        </head>
        <body>
            <div class="head">
               <div class="text">
                    Добродојдовте на страната на стоматолошката ординација
                    
                </div>
                <div class="logo"></div>
             </div>
            <% 
            if (request.getSession().getValue("permisija") == null){
                response.sendRedirect("index.jsp?error=true");
            }
            String permisija = request.getSession().getValue("permisija").toString();
            if (permisija.equals("user") || permisija.isEmpty()) {
              response.sendRedirect("user.jsp?error=true");
            }
           // out.println("<h2>"+permisija+"</h2>");
        %>
            <h1><h:outputText value="Промени пациент"/></h1>
            <% com.zproekt.entity.Pacient pacient = OrdinacijaCRUD.getPacient(Long.valueOf(request.getParameter("id")));
                pageContext.setAttribute("pacient", pacient);
            %>
            <form action="izmeniPacient.do">
                <input type="text" value="${pacient.getId()}" style="display: none" name="id"/>
                ИМЕ:<input type="text" value="${pacient.getIme()}" name="ime"/></br>
                ПРЕЗИМЕ:<input type="text" value="${pacient.getPrezime()}" name="prezime"/></br>
                ЕМБГ:<input type="text" value="${pacient.getEmbg()}" name="embg"/></br>
                <select name="credential">
                    <option value="user">Пациент</option>
                    <option value="admin">Сестра</option>
                    <option value="admin">Доктор</option>
                </select></br>
                <input type="submit" value="Ажурирај"/>
            </form>
                <br/>
            <form action="admin.jsp">
                <input type="submit" value="Откажи!"/>
            </form>
                <div class="footer">
                        Copyright Ruzin © 2011
           </div>
        </body>
    </html>
</f:view>
